package com.partsoft.webs.spring.zks;

import java.util.Iterator;
import java.util.List;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventThreadCleanup;

import com.partsoft.webs.log.Log;

public class ExceptionInterceptor implements EventThreadCleanup {
	public void cleanup(Component comp, Event evt, List<Throwable> errs) throws Exception {
		if ((errs != null) && (!errs.isEmpty())) {
			Iterator<Throwable> eIt = errs.iterator();
			while (eIt.hasNext()) {
				Log.error((Throwable) eIt.next());
			}
		}
	}

	public void complete(Component component, Event event) throws Exception {
	}
}